package create.factory_abstract;

import create.factory_abstract.factory.BusinessFactory;
import create.factory_abstract.factory.CarFactory;
import create.factory_abstract.product.BenzCar;
import create.factory_abstract.product.TeslaCar;

/**
 * @author lzp
 * @Date:2023/2/23
 * @description: 抽象工厂测试
 */
public class FactoryAbstractDemo {

	public static void main(String[] args) {
		// 获取一个商务车工厂
		CarFactory factory = new BusinessFactory();

		// 得到奔驰跑车，并加油
		BenzCar benzCar = factory.getBenzCar();
		benzCar.gasUp();

		// 得到特斯拉跑车，并充电
		TeslaCar teslaCar = factory.getTeslaCar();
		teslaCar.charge();

	}

}
